package com.suray.rgv.son.data;

import lombok.Data;

import java.util.List;

/**
 * 子车控制报文
 */
@Data
public class RgvSonControlBean {
    /*********************************************任务信息***********************************************/

    //1表示左侧；3表示右侧；
    private Integer taskDirection;

    //有效距离的个数
    private Integer nodeNum;

    //原点条码值H
    private Integer originalCodeH;

    //原点条码值L
    private Integer originalCodeL;

    //地图节点信息，长度30
    private List<NodeInfo> nodeInfo;

    //任务编号, 每下发一个任务，此任务编号增1，循环递增；取值范围：1~255
    private Integer taskId;

    //启动任务, 写1开始执行任务
    private Integer startTask;

    //段序号, 小车行驶的目标位置对应的段序号
    private Integer segment;

    //任务节点个数, taskInfo长度 * 2
    private Integer taskNodeNum;

    private List<TaskInfo> taskInfo;

    @Data
    public static class TaskInfo {
        //位置, nodeInfo中对应位置的下标
        Integer location;
        //动作
        Integer action;

        public TaskInfo(Integer location, Integer action) {
            this.location = location;
            this.action = action;
        }
    }

    @Data
    public static class NodeInfo {
        //地码
        private Integer codeH;
        private Integer codeL;
        //位移量
        private Integer distance;

        public NodeInfo(Integer codeH, Integer codeL, Integer distance) {
            this.codeH = codeH;
            this.codeL = codeL;
            this.distance = distance;
        }
    }

    /*************************************************************************************************/

//    public RgvSonControlBean() {
//        this.task_num = 0;
//        this.start = 0;
//        this.operation = 0;
//        this.direction = 0;
//        this.codeH = 0;
//        this.codeL = 0;
//        this.node_num = 0;
////        this.interval_dist = 0;
//        this.accelerate_speed = 0;
//        this.decelerate_speed = 0;
//        this.speed = 0;
//        this.accelerate_lift = 0;
//        this.decelerate_lift = 0;
//        this.speed_lift = 0;
//        this.action_conf = 0;
//        this.life = 0;
//    }
}
